﻿<Controls:SinacorWindow
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:Custom="http://schemas.xceed.com/wpf/xaml/datagrid"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	
		xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls"
	
	WindowStartupLocation="CenterScreen"
    WindowState="Maximized"
	Title="{DynamicResource Bovespa.Parametro.Label.CadastroCustodiantesADR}"
	
	x:Class="Sinacor.UI.Bovespa.Parametro.View.SmartClient.CadastroCustodianteADR"
    ModulePlus="False"
    ModuleId="ORD">

    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Controls:SinacorExpanderContainer Width="Auto" Height="Auto">
            <Controls:SinacorExpanderContainer.RowDefinitions>
                <RowDefinition Height="77" />
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
            </Controls:SinacorExpanderContainer.RowDefinitions>
            <Controls:SinacorExpander Grid.Row="0"
									  HorizontalAlignment="Stretch"
									  VerticalAlignment="Stretch"
									  Header="{DynamicResource Bovespa.Parametro.Label.FiltrarCustodiantesAtivo}"
									  IsExpanded="True" 
									  Height="Auto">
                <Grid>
                    <Controls:SinacorLabel HorizontalAlignment="Left" 
						                    Content="{DynamicResource Bovespa.Parametro.Label.Ativo}" 
						                    Width="80" 
						                    Margin="0,8,0,0" />
                    <Controls:SinacorTextBox HorizontalAlignment="Left" 
                                             Margin="84,8,0,0"
											 TabIndex="1" 
											 Width="115" 
											 VerticalAlignment="Top" 
											 MaxLength="12"
                                             x:Name="TxtAtivo"
                                             Text="{Binding FiltroCustodiante.Ativo}"/>
                    <Controls:SinacorButton HorizontalAlignment="Left"
											Icon="IconButtonSearch"
											ToolTip="{DynamicResource Bovespa.Parametro.Label.PesquisarAtivo}"
											Margin="203,8,0,0" 
											VerticalAlignment="Top" 
											TabIndex="2" 
                                            x:Name="BtnAtivo"
                                            Click="BtnAtivo_Click"/>
                    <Controls:SinacorButton HorizontalAlignment="Left"
            			                    Margin="261,8,0,0"
            			                    Width="100"
            			                    Content="{DynamicResource Bovespa.Parametro.Label.Filtrar}"
            			                    VerticalAlignment="Top"
            			                    IsDefault="True"
            			                    TabIndex="3"
                                            x:Name="BtnFiltrar"
                                            Click="BtnFiltrar_Click"/>
                    <Controls:SinacorButton HorizontalAlignment="Left"
            			                    Margin="365,8,0,0"
            			                    Width="135"
            			                    Content="{DynamicResource Bovespa.Parametro.Label.DesfazerFiltro}"
            			                    VerticalAlignment="Top"
            			                    TabIndex="4" 
                                            x:Name="BtnDesfazerFiltro"
                                            Click="BtnDesfazerFiltro_Click"/>
                </Grid>
            </Controls:SinacorExpander>
            <Controls:SinacorExpander Grid.Row="1"
									  HorizontalAlignment="Stretch"
									  VerticalAlignment="Stretch"
									  Header="{DynamicResource Bovespa.Parametro.Label.Custodiantes}"
									  IsExpanded="True" 
									  Margin="0,4,0,0">
                <Grid>

                    <Controls:SinacorDataGrid x:Name="DtgCustodiante"
											  HorizontalAlignment="Stretch"
											  Width="Auto" 										
											  IsSynchronizedWithCurrentItem="True" 										
											  VerticalAlignment="Stretch" 										
											  Margin="0,0,0,0"
											  AllowBeginInsert="True" 
                            				  AllowBeginUpdate="True"
											  AllowCancelInsert="True"
											  AllowCancelUpdate="True"
											  AllowSave="True" 
											  AllowDelete="True"  
											  AllowUndoLast="False" 											  
											  AllowUndo="False" 
											  TabIndex="5" 
                                              RowEditMode="AllCells"                                              
                                              EndingInsert="DtgCustodiante_EndingInsert"                                              
                                              Deleting="DtgCustodiante_Deleting"
                                              CancelingInsert="DtgCustodiante_Canceling"
                                              CancelingUpdate="DtgCustodiante_Canceling"
                                              SelectionChanged="DtgCustodiante_SelectionChanged"
                                              ItemsSource="{Binding ListaCustodiantes}">

                        <Controls:SinacorDataGrid.Columns>
                            <Controls:Column Name="Codigo" 
    										 Title="Bovespa.Parametro.Label.Codigo" 
                                             DisplayMemberPath="Codigo"
                                             AllowInsert="True"
                                             Integers="5"
                                             HorizontalCellAlignment="Right"
                                             StringFormat="######0"
                                             IsRequired="True"
                                             RequiredErrorMessage="FaturamentoBovespa.Cadastros.Message.CodigoCustodianteObrigatorio"/>
                            <Controls:Column Name="DV" 
    										 Title="Bovespa.Parametro.Label.DV" 
                                             DisplayMemberPath="DigitoVerificador"
                                             HorizontalCellAlignment="Right"
                                             CellInsertTemplate="{Binding CellUpdateTemplate, RelativeSource={RelativeSource Self}}"
                                             AllowInsert="True">
                                <Controls:Column.CellUpdateTemplate>
                                    <DataTemplate>
                                        <Controls:SinacorInt16TextBox x:Name="TxtDigitoVerificador"
                                                                      Integers="1"
                                                                      IsRequired="True"
                                                                      RequiredErrorMessage="FaturamentoBovespa.Cadastros.Message.DigVerifCustodianteObrigatorio"
                                                                      Value="{Binding DigitoVerificador}"/>

                                    </DataTemplate>
                                </Controls:Column.CellUpdateTemplate>
                            </Controls:Column>
                            <Controls:Column Name="Nome" 
    										 Title="Bovespa.Parametro.Label.Nome" 
                                             DisplayMemberPath="NomeCustodiante"
                                             MaxLength="30"
                                             IsRequired="True"
                                             AllowInsert="True"
                                             RequiredErrorMessage="FaturamentoBovespa.Cadastros.Message.NomeCustodianteObrigatorio"/>
                        </Controls:SinacorDataGrid.Columns>
                    </Controls:SinacorDataGrid>

                </Grid>
            </Controls:SinacorExpander>
            <Controls:SinacorExpander Grid.Row="2"
            	                        HorizontalAlignment="Stretch"
            	                        VerticalAlignment="Stretch"
            	                        Header="{DynamicResource Bovespa.Parametro.Label.ADR}"
            	                        IsExpanded="True"
                                        Margin="0,4,0,0">
                <Grid>
                    <Controls:SinacorDataGrid x:Name="DtgADR"
                                                HorizontalAlignment="Stretch"
                                                Width="Auto"
                                                IsSynchronizedWithCurrentItem="True" 										
                                                VerticalAlignment="Stretch" 										
                                                Margin="0,0,0,0"
                                                AllowBeginInsert="True"
                                                AllowBeginUpdate="True"
                                                AllowCancelInsert="True"
                                                AllowCancelUpdate="True"
                                                AllowSave="True"
                                                AllowDelete="True"
                                                AllowEndInsert="True"
                                                AllowEndUpdate="True"
                                                AllowSaveAll="True"
                                                AllowUndo="True"
                                                AllowUndoAll="True"
                                                AllowUndoLast="True"
                                                SelectionChanged="DtgADR_SelectionChanged"
                                                SavingAll="DtgADR_SavingAll"
                                                TabIndex="6"
                                                RowEditMode="AllCells"
                                                ItemsSource="{Binding ListaADR}">

                        <Controls:SinacorDataGrid.Columns>
                            <Controls:Column Name="Cliente" 
											 Title="Bovespa.Parametro.Label.Cliente" 
                                             DisplayMemberPath="CodigoCliente"
                                             Integers="7"
                                             StringFormat="######0"
                                             HorizontalCellAlignment="Right"
                                             AllowInsert="True"
                                             AllowUpdate="True"
                                             IsRequired="True"/>
                            <Controls:Column Name="DV" 
            								 Title="Bovespa.Parametro.Label.DV" 
                                             DisplayMemberPath="DigitoCliente"
                                             Integers="1"
                                             MaxLength="1"  
                                             HorizontalCellAlignment="Right"
                                             AllowInsert="True"
                                             AllowUpdate="True"
                                             CellInsertTemplate="{Binding CellUpdateTemplate, RelativeSource={RelativeSource Self}}"                                             
                                             IsRequired="True">
                                <Controls:Column.CellUpdateTemplate>
                                    <DataTemplate>
                                        <Controls:SinacorInt16TextBox x:Name="TxtDigitoCliente"
                                                                      Integers="1"
                                                                      IsRequired="True"
                                                                      Value="{Binding DigitoCliente}"/>

                                    </DataTemplate>
                                </Controls:Column.CellUpdateTemplate>
                            </Controls:Column>
                            <Controls:Column Name="Ativo" 
            								 Title="Bovespa.Parametro.Label.Ativo" 
                                             DisplayMemberPath="Ativo"
                                             AllowInsert="True"
                                             AllowUpdate="False"
                                             MaxLength="12"
                                             IsRequired="True"/>
                            <Controls:Column Name="Nivel" 
            								 Title="Bovespa.Parametro.Label.Nivel" 
                                             DisplayMemberPath="Nivel"
                                             Integers="5"
                                             MaxLength="5"
                                             StringFormat="####0"
                                             AllowInsert="True"
                                             AllowUpdate="False"
                                             IsRequired="True"/>
                            <Controls:Column Name="QuantidadeShares" 
            								 Title="Bovespa.Parametro.Label.QteShares" 
                                             DisplayMemberPath="QuantidadeShares"
                                             Integers="7"
                                             HorizontalCellAlignment="Right"
                                             StringFormat="#######0"
                                             AllowInsert="True"
                                             AllowUpdate="True"
                                             IsRequired="True"/>
                        </Controls:SinacorDataGrid.Columns>
                    </Controls:SinacorDataGrid>
                </Grid>
            </Controls:SinacorExpander>
        </Controls:SinacorExpanderContainer>
    </Grid>
</Controls:SinacorWindow>